package com.qumap.server.request;

import com.google.gwt.user.server.rpc.RemoteServiceServlet;
import com.qumap.item.content.ObjectOnMap;
import com.qumap.item.content.ObjectOnMapShort;
import com.qumap.item.request.filter.entry.FilterEntry;
import com.qumap.item.test.iteminfo.item2.load.IT2FilterProcessor;
import com.qumap.server.LoadProcessorHelper;

import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * User: Admin
 * Date: 26.06.11
 * Time: 15:43
 * To change this template use File | Settings | File Templates.
 */
public class T2FilterAndLoadProcessor extends RemoteServiceServlet implements IT2FilterProcessor {

    private LoadProcessorHelper<ObjectOnMap> processr_helper = new LoadProcessorHelper<ObjectOnMap>() {
        @Override
        public ObjectOnMap buildContent() {
            return new ObjectOnMap();
        }

        @Override
        public void initItem(ObjectOnMap new_item) {
            new_item.setDescription("D "+new_item.getId());
        }
    };

    @Override
    public List<ObjectOnMapShort> getFilteredObjects(List<FilterEntry> filters) {
        return processr_helper.getFilteredObjects(filters);
    }

    @Override
    public ObjectOnMapShort loadObject(int object_id) {
        return processr_helper.getObject(object_id);
    }
}
